package com.ruoyi.wgjlcData.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.wgjlcData.domain.plat.DataWgjlcZshhjsh;
import com.ruoyi.wgjlcData.mapper.DataWgjlcZshhjshMapper;
import com.ruoyi.wgjlcData.service.IDataWgjlcZshhjshService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.AsyncResult;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.concurrent.Future;


/**
 * 无轨胶轮车噪声和警声测试项Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-02-27
 */
@Service
public class DataWgjlcZshhjshServiceImpl implements IDataWgjlcZshhjshService
{
    @Autowired
    private DataWgjlcZshhjshMapper dataWgjlcZshhjshMapper;

    /**
     * 查询无轨胶轮车噪声和警声测试项
     * 
     * @param zshhjshId 无轨胶轮车噪声和警声测试项主键
     * @return 无轨胶轮车噪声和警声测试项
     */
    @Override
    public DataWgjlcZshhjsh selectDataWgjlcZshhjshByZshhjshId(Long zshhjshId)
    {
        return dataWgjlcZshhjshMapper.selectDataWgjlcZshhjshByZshhjshId(zshhjshId);
    }

    /**
     * 查询无轨胶轮车噪声和警声测试项列表
     * 
     * @param dataWgjlcZshhjsh 无轨胶轮车噪声和警声测试项
     * @return 无轨胶轮车噪声和警声测试项
     */
    @Override
    public List<DataWgjlcZshhjsh> selectDataWgjlcZshhjshList(DataWgjlcZshhjsh dataWgjlcZshhjsh)
    {
        return dataWgjlcZshhjshMapper.selectDataWgjlcZshhjshList(dataWgjlcZshhjsh);
    }

    /**
     * 新增无轨胶轮车噪声和警声测试项
     * 
     * @param dataWgjlcZshhjsh 无轨胶轮车噪声和警声测试项
     * @return 结果
     */
    @Override
    public int insertDataWgjlcZshhjsh(DataWgjlcZshhjsh dataWgjlcZshhjsh)
    {
        dataWgjlcZshhjsh.setCreateTime(DateUtils.getNowDate());
        return dataWgjlcZshhjshMapper.insertDataWgjlcZshhjsh(dataWgjlcZshhjsh);
    }

    /**
     * 修改无轨胶轮车噪声和警声测试项
     * 
     * @param dataWgjlcZshhjsh 无轨胶轮车噪声和警声测试项
     * @return 结果
     */
    @Override
    public int updateDataWgjlcZshhjsh(DataWgjlcZshhjsh dataWgjlcZshhjsh)
    {
        dataWgjlcZshhjsh.setUpdateTime(DateUtils.getNowDate());
        return dataWgjlcZshhjshMapper.updateDataWgjlcZshhjsh(dataWgjlcZshhjsh);
    }

    /**
     * 查询无轨胶轮车-噪声和警声测试项
     *
     * @param dataTaskId
     * @return 无轨胶轮车-噪声和警声测试项
     */
    @Override
    public Future<List<DataWgjlcZshhjsh>> selectDataWgjlcZshhjshByDataTaskId(Long dataTaskId) {
        return new AsyncResult<>(dataWgjlcZshhjshMapper.selectDataWgjlcZshhjshByDataTaskId(dataTaskId));
    }

    /**
     * 修改状态为2
     *
     * @param dataTaskId
     */
    @Override
    public int updateDataWgjlcZshhjshByDataTaskId(Long dataTaskId) {
        return dataWgjlcZshhjshMapper.updateDataWgjlcZshhjshByDataTaskId(dataTaskId);
    }

    /**
     * 批量新增无轨胶轮车-噪声和警声测试项
     *
     * @param dataWgjlcZshhjsh 无轨胶轮车-噪声和警声测试项
     * @return 结果
     */
    @Override
    public int batchDataWgjlcZshhjsh(List<DataWgjlcZshhjsh> dataWgjlcZshhjsh) {
        return dataWgjlcZshhjshMapper.batchDataWgjlcZshhjsh(dataWgjlcZshhjsh);
    }

    /**
     * 批量删除无轨胶轮车噪声和警声测试项
     * 
     * @param zshhjshIds 需要删除的无轨胶轮车噪声和警声测试项主键
     * @return 结果
     */
    @Override
    public int deleteDataWgjlcZshhjshByZshhjshIds(Long[] zshhjshIds)
    {
        return dataWgjlcZshhjshMapper.deleteDataWgjlcZshhjshByZshhjshIds(zshhjshIds);
    }

    /**
     * 删除无轨胶轮车噪声和警声测试项信息
     * 
     * @param zshhjshId 无轨胶轮车噪声和警声测试项主键
     * @return 结果
     */
    @Override
    public int deleteDataWgjlcZshhjshByZshhjshId(Long zshhjshId)
    {
        return dataWgjlcZshhjshMapper.deleteDataWgjlcZshhjshByZshhjshId(zshhjshId);
    }
}
